package string;

public class StringDemo {
    public static void main(String[] args) {
        String s1 = "abc123";
        String s2 = "abc123";
        System.out.println(s1);
        System.out.println(s2);

        String s3 = new String("abc123");
        System.out.println(s3);
        System.out.println(s1==s2);
        System.out.println(s1==s3);

        String s4 = "123";
        String s5 = "abc"+s4;
        System.out.println(s5 == s1);
        String s6 = "abc"+"123";
        System.out.println(s6 == s1);

        String s7 = "abc132";
        String s8 = new String("abc123");
        System.out.println(s7==s8);
        System.out.println(s7.equals(s8));
    }
}
